<?php
namespace Home\Controller;
use Model\NewsModel;
use Think\Controller;

class NewsController extends BaseController {

    public function __construct()
    {
        parent::__construct();

    }

    public function detail()
    {
        $id = intval(I("get.id"));
        if(empty($id)){
            $this->error("非法参数");
        }
        $newsModel = new NewsModel();
        $data = $newsModel->find($id);
        $this->assign("data",$data);
        $this->display();
    }
}